#ifndef FILEHANDLER_H
#define FILEHANDLER_H

#include "collection.h"
#include "dttrack.h"
#include <QString>
#include <QFile>

static const QString fileHandlerStr =
        QObject::tr("FileHandler Error");
static const QString fileNotRemovedStr =
        QObject::tr("File can't be removed");
static const QString fileRemovedStr =
        QObject::tr("File removed");
static const QString fileNotExistStr =
        QObject::tr("File does't exists");
static const QString fileHandlerRmvFileStr = "removeFile";
static const QString fileHandlerIsFileExist = "isFileExist";

class FileHandler
{
public:
    FileHandler();
    /**
    *File handles class
    *Manages the files used in the database
    */
    /**
    *removes a FILE
    *@param fileName is a string variable
    *@return the statement whether the removal was succesful or not
    */
    bool removeFile(QString fileName);

    /**
    *checks if a file exist
    *@param fileName is a string variable
    *@return the statement whether file exists or not
    */
    bool isFileExist(QString fileName);

    /**
     * @brief getMusic get all file (ogg, flac, mp3...) in folder.
     * @param folder is the folder of librairie
     * @return the statement wether the getter was succesful or not
     */
    static bool getMusic(QString folder, Collection &collection);
};

#endif // FILEHANDLER_H
